// Copyright 2011-2021 Tyler Gilbert and Stratify Labs, Inc; see LICENSE.md




#ifndef SFFS_DIAG_H_
#define SFFS_DIAG_H_


#include "sffs_local.h"

typedef struct {
	int free_blocks;
	int allocated_blocks;
	int used_blocks;
	int dirty_blocks;
	int eraseable_blocks;
	int total_blocks;
	int dir_list_blocks;
	int file_data_blocks;
	int serialno_list_blocks;
	int del_serialno_list_blocks;
	int file_list_blocks;
} sffs_diag_t;



typedef struct {
	int list_blocks;
	int dirty_blocks;
	int used_blocks;
	int allocated_blocks;
	int total_blocks;
} sffs_diag_file_t;


int sffs_diag_scan(const void * cfg);
int sffs_diag_get(const void * cfg, sffs_diag_t * dest);
void sffs_diag_show(sffs_diag_t * data);

int sffs_diag_getfile(const void * cfg, const char * path, sffs_diag_file_t * dest);
void sffs_diag_showfile(sffs_diag_file_t * data);

int sffs_diag_show_eraseable(const void * cfg);

int sffs_diag_scandir(const void * cfg, serial_t serialno);
int sffs_diag_scanfile(const void * cfg, serial_t serialno);



#endif /* SFFS_DIAG_H_ */
